package com.zhangcuishan.blog.config;

import com.theokanning.openai.OpenAiService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OpenAiConfig {

    @Value("${openai.apiKey}")
    private String OPEN_API_KEY;

    @Bean
    public OpenAiService getOpenAiService() {
        OpenAiService service = new OpenAiService(OPEN_API_KEY, 5000);
        return service;
    }
}
